You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The obvious in domains/the ens service/transfer to implement the comment
sentToHistory in the activity controller. We need it anyway for ENS so I figured we can also use it instead of traversing every account op
recipientDomain to Call - I tested many different solutions in the past two days and trust me, this one is the most reliable because there are many edge cases - the user sends to an address that has ENS, but hasn't typed the ENS; the user sends to an ENS, but then starts a new transfer before the txn is confirmed; the user sends to an ENS, but then adds to batch. We MUST save the ENS to storage ONLY if the user has typed it in manually, the ENS resolves to a different address and the user has typed THE SAME name again. (e.g., yesterday nick.eth -> 1; today nick.eth -> 2) as it would be confusing if the user has never sent to the user by typing in the ENS and we warn him that it changed
Transfer warning. Use the following script, reload the extension and then input the name in the send form. It's important that you do so manually and don't pick the account from the address dropdown as that will fill the field with the address and not display the warning (as it's not needed)
addAccountOp now persists accountsOps and then sentToHistory in two sequential storage.set calls without atomicity or rollback. If the second write fails (or the process crashes between them), the next load will contain the account operation but no corresponding sent-to history. This breaks the fast-path in hasAccountOpsSentTo and can cause false first-send warnings (including address-poisoning checks) for addresses the user has already sent to.
dismissEnsExpiryBannerForTheSelectedAccount awaits this.#storage.set() without a try/catch or withStatus wrapper. If the storage write throws, the error propagates uncaught to the caller, violating the invariant that public controller methods must never propagate errors silently.
asyncdismissEnsExpiryBannerForTheSelectedAccount(){if(!this.account)returnconstexpiry=this.#domains?.domains[getAddress(this.account.addr)]?.ensExpiryif(!expiry)return// Key the dismissal by expiry timestamp so a renewed name (new expiry) shows the banner again.constdismissKey=`${this.account.addr}-${expiry.expiresAt}`if(!this.dismissedBannerIds[ensExpiryBannerId])this.dismissedBannerIds[ensExpiryBannerId]=[]if(!this.dismissedBannerIds[ensExpiryBannerId]!.includes(dismissKey))this.dismissedBannerIds[ensExpiryBannerId]!.push(dismissKey)awaitthis.#storage.set('selectedAccountDismissedBannerIds',this.dismissedBannerIds)this.emitUpdate()}
shouldRefetchEnsExpiry returns true when ensExpiry is null, which is the cached "fetched but not relevant" state for non-.eth names (e.g., DNS names or unregistered names). This causes getEnsExpiry to be invoked again on every selected-account refresh, wasting RPC calls and degrading performance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To be done:
Implements https://github.com/AmbireTech/ambire-app/issues/6853#issuecomment-4478478774
Changes:
sentToHistoryin the activity controller. We need it anyway for ENS so I figured we can also use it instead of traversing every account oprecipientDomaintoCall- I tested many different solutions in the past two days and trust me, this one is the most reliable because there are many edge cases - the user sends to an address that has ENS, but hasn't typed the ENS; the user sends to an ENS, but then starts a new transfer before the txn is confirmed; the user sends to an ENS, but then adds to batch. We MUST save the ENS to storage ONLY if the user has typed it in manually, the ENS resolves to a different address and the user has typed THE SAME name again. (e.g., yesterday nick.eth -> 1; today nick.eth -> 2) as it would be confusing if the user has never sent to the user by typing in the ENS and we warn him that it changedRelevant info and docs:
Useful apps:
How to test: